pull: Add --prefer-loose option
authorColin Walters <walters@verbum.org>
Thu, 10 May 2012 13:54:56 +0000 (09:54 -0400)
committerColin Walters <walters@verbum.org>
Thu, 10 May 2012 13:54:56 +0000 (09:54 -0400)
This is a hack...

src/ostree/ostree-pull.c

index 3534c19cb339c697f7c536ebfc5a6b4097dd3c1a..9613828e7c54f063d3c7088c74f6afb4cef9e564 100644 (file)
 #include "ot-main.h"
 
 gboolean verbose;
+gboolean opt_prefer_loose;
 
 static GOptionEntry options[] = {
   { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Show more information", NULL },
+  { "prefer-loose", 0, 0, G_OPTION_ARG_NONE, &opt_prefer_loose, "Download loose objects by default", NULL },
   { NULL },
 };
 
@@ -891,7 +893,7 @@ fetch_content (OtPullData           *pull_data,
                                        cancellable, error))
         goto out;
 
-      if (remote_pack_checksum)
+      if (remote_pack_checksum && !opt_prefer_loose)
         {
           files_to_fetch = g_hash_table_lookup (data_packs_to_fetch, remote_pack_checksum);
           if (files_to_fetch == NULL)